//
//  ViewController.swift
//  FloatingWindowExample
//
//  Created by Jason on 2021/8/11.
//

import UIKit
import SnapKit
import SwifterSwift

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.addSubview(btn)
        btn.snp.makeConstraints { make in
            make.center.equalToSuperview()
            make.width.height.equalTo(100)
        }
        
    }


    fileprivate lazy var btn:UIButton = {
        let btn = UIButton.init(type: UIButton.ButtonType.custom)
        btn.setTitle("语音通话", for: .normal)
        btn.backgroundColor = #colorLiteral(red: 0.3411764801, green: 0.6235294342, blue: 0.1686274558, alpha: 1)
        btn.cornerRadius = 10
        btn.setTitleColor(.white, for: .normal)
        btn.addTarget(self, action: #selector(click), for: UIControl.Event.touchUpInside)
        return btn
    }()
    
    
}

extension ViewController{
    
    
    @objc fileprivate func click(){
        
        let controller = VoiceChatViewController()
        
        controller.modalPresentationStyle = .overCurrentContext
        
        self.present(controller, animated: true, completion: nil)
    }
}


